home *** CD-ROM | disk | FTP | other *** search
/ PC Users 8 / Cd Pc Users extra 8.iso / prog / inst / firstimp / vcimpres.z / chartfrm.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-11-07  |  32.1 KB  |  1,032 lines

  1. VERSION 5.00
  2. Object = "{5A721583-5AF0-11CE-8384-0020AF2337F2}#1.0#0"; "VCFI32.OCX"
  3. Begin VB.Form frmMain 
  4.    Caption         =   "First Impression Chart Type Examples"
  5.    ClientHeight    =   5655
  6.    ClientLeft      =   1110
  7.    ClientTop       =   1725
  8.    ClientWidth     =   9495
  9.    Icon            =   "chartfrm.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   5655
  13.    ScaleWidth      =   9495
  14.    Begin VB.Frame fraControls 
  15.       Height          =   735
  16.       Left            =   0
  17.       TabIndex        =   1
  18.       Top             =   0
  19.       Width           =   9495
  20.       Begin VB.CommandButton SSCommand16 
  21.          BeginProperty Font 
  22.             Name            =   "MS Sans Serif"
  23.             Size            =   9.75
  24.             Charset         =   0
  25.             Weight          =   700
  26.             Underline       =   0   'False
  27.             Italic          =   0   'False
  28.             Strikethrough   =   0   'False
  29.          EndProperty
  30.          Height          =   375
  31.          Left            =   6000
  32.          Picture         =   "chartfrm.frx":030A
  33.          Style           =   1  'Graphical
  34.          TabIndex        =   2
  35.          Top             =   240
  36.          Width           =   375
  37.       End
  38.       Begin VB.CommandButton SSCommand15 
  39.          BeginProperty Font 
  40.             Name            =   "MS Sans Serif"
  41.             Size            =   9.75
  42.             Charset         =   0
  43.             Weight          =   700
  44.             Underline       =   0   'False
  45.             Italic          =   0   'False
  46.             Strikethrough   =   0   'False
  47.          EndProperty
  48.          Height          =   375
  49.          Left            =   5640
  50.          Picture         =   "chartfrm.frx":07C0
  51.          Style           =   1  'Graphical
  52.          TabIndex        =   19
  53.          Top             =   240
  54.          Width           =   375
  55.       End
  56.       Begin VB.CommandButton SSCommand5 
  57.          Height          =   375
  58.          Left            =   5160
  59.          Picture         =   "chartfrm.frx":0BDE
  60.          Style           =   1  'Graphical
  61.          TabIndex        =   18
  62.          Top             =   240
  63.          Width           =   375
  64.       End
  65.       Begin VB.CommandButton SSCommand14 
  66.          Height          =   375
  67.          Left            =   4800
  68.          Picture         =   "chartfrm.frx":1120
  69.          Style           =   1  'Graphical
  70.          TabIndex        =   17
  71.          Top             =   240
  72.          Width           =   375
  73.       End
  74.       Begin VB.CommandButton SSCommand13 
  75.          Height          =   375
  76.          Left            =   4440
  77.          Picture         =   "chartfrm.frx":164E
  78.          Style           =   1  'Graphical
  79.          TabIndex        =   15
  80.          Top             =   240
  81.          Width           =   375
  82.       End
  83.       Begin VB.CommandButton SSCommand12 
  84.          Height          =   375
  85.          Left            =   4080
  86.          Picture         =   "chartfrm.frx":1B04
  87.          Style           =   1  'Graphical
  88.          TabIndex        =   14
  89.          Top             =   240
  90.          Width           =   375
  91.       End
  92.       Begin VB.CommandButton SSCommand11 
  93.          Height          =   375
  94.          Left            =   3720
  95.          Picture         =   "chartfrm.frx":2046
  96.          Style           =   1  'Graphical
  97.          TabIndex        =   13
  98.          Top             =   240
  99.          Width           =   375
  100.       End
  101.       Begin VB.CommandButton SSCommand10 
  102.          Height          =   375
  103.          Left            =   3360
  104.          Picture         =   "chartfrm.frx":2548
  105.          Style           =   1  'Graphical
  106.          TabIndex        =   12
  107.          Top             =   240
  108.          Width           =   375
  109.       End
  110.       Begin VB.CommandButton SSCommand9 
  111.          Height          =   375
  112.          Left            =   3000
  113.          Picture         =   "chartfrm.frx":2ACA
  114.          Style           =   1  'Graphical
  115.          TabIndex        =   11
  116.          Top             =   240
  117.          Width           =   375
  118.       End
  119.       Begin VB.CommandButton SSCommand8 
  120.          Height          =   375
  121.          Left            =   2640
  122.          Picture         =   "chartfrm.frx":2FCC
  123.          Style           =   1  'Graphical
  124.          TabIndex        =   10
  125.          Top             =   240
  126.          Width           =   375
  127.       End
  128.       Begin VB.CommandButton SSCommand7 
  129.          Height          =   375
  130.          Left            =   2280
  131.          Picture         =   "chartfrm.frx":3446
  132.          Style           =   1  'Graphical
  133.          TabIndex        =   9
  134.          Top             =   240
  135.          Width           =   375
  136.       End
  137.       Begin VB.CommandButton SSCommand6 
  138.          Height          =   375
  139.          Left            =   1920
  140.          Picture         =   "chartfrm.frx":38FC
  141.          Style           =   1  'Graphical
  142.          TabIndex        =   8
  143.          Top             =   240
  144.          Width           =   375
  145.       End
  146.       Begin VB.CommandButton SSCommand17 
  147.          Height          =   375
  148.          Left            =   1560
  149.          Picture         =   "chartfrm.frx":3DB2
  150.          Style           =   1  'Graphical
  151.          TabIndex        =   7
  152.          Top             =   240
  153.          Width           =   375
  154.       End
  155.       Begin VB.CommandButton SSCommand4 
  156.          Height          =   375
  157.          Left            =   1200
  158.          Picture         =   "chartfrm.frx":42A4
  159.          Style           =   1  'Graphical
  160.          TabIndex        =   6
  161.          Top             =   240
  162.          Width           =   375
  163.       End
  164.       Begin VB.ComboBox cboChartType 
  165.          BeginProperty Font 
  166.             Name            =   "MS Sans Serif"
  167.             Size            =   9.75
  168.             Charset         =   0
  169.             Weight          =   700
  170.             Underline       =   0   'False
  171.             Italic          =   0   'False
  172.             Strikethrough   =   0   'False
  173.          EndProperty
  174.          ForeColor       =   &H00FF0000&
  175.          Height          =   360
  176.          Left            =   6480
  177.          Style           =   2  'Dropdown List
  178.          TabIndex        =   5
  179.          Top             =   240
  180.          Width           =   2895
  181.       End
  182.       Begin VB.CommandButton SSCommand3 
  183.          Height          =   375
  184.          Left            =   840
  185.          Picture         =   "chartfrm.frx":475A
  186.          Style           =   1  'Graphical
  187.          TabIndex        =   16
  188.          Top             =   240
  189.          Width           =   375
  190.       End
  191.       Begin VB.CommandButton SSCommand2 
  192.          Height          =   375
  193.          Left            =   480
  194.          Picture         =   "chartfrm.frx":4C4C
  195.          Style           =   1  'Graphical
  196.          TabIndex        =   3
  197.          Top             =   240
  198.          Width           =   375
  199.       End
  200.       Begin VB.CommandButton SSCommand1 
  201.          Height          =   375
  202.          Left            =   120
  203.          Picture         =   "chartfrm.frx":514E
  204.          Style           =   1  'Graphical
  205.          TabIndex        =   4
  206.          Top             =   240
  207.          Width           =   375
  208.       End
  209.    End
  210.    Begin VCIFiLib.VtChart VtChart1 
  211.       Height          =   3975
  212.       Left            =   240
  213.       OleObjectBlob   =   "chartfrm.frx":57F0
  214.       TabIndex        =   0
  215.       Top             =   1020
  216.       Width           =   4215
  217.    End
  218.    Begin VB.Menu File 
  219.       Caption         =   "&File"
  220.       Begin VB.Menu FileRead 
  221.          Caption         =   "Read Chart (VTC)..."
  222.       End
  223.       Begin VB.Menu FileWrite 
  224.          Caption         =   "WriteChart (VTC)..."
  225.          WindowList      =   -1  'True
  226.       End
  227.       Begin VB.Menu FileSep0 
  228.          Caption         =   "-"
  229.       End
  230.       Begin VB.Menu FileMeta 
  231.          Caption         =   "Write Metafile"
  232.       End
  233.       Begin VB.Menu WriteBMP 
  234.          Caption         =   "Write Bitmap File..."
  235.       End
  236.       Begin VB.Menu FileSep1 
  237.          Caption         =   "-"
  238.       End
  239.       Begin VB.Menu FilePrinterSetup 
  240.          Caption         =   "Printer Setup..."
  241.       End
  242.       Begin VB.Menu FilePrint 
  243.          Caption         =   "&Print"
  244.       End
  245.       Begin VB.Menu FileSep2 
  246.          Caption         =   "-"
  247.       End
  248.       Begin VB.Menu FileExit 
  249.          Caption         =   "E&xit"
  250.       End
  251.    End
  252.    Begin VB.Menu Edit 
  253.       Caption         =   "&Edit"
  254.       Begin VB.Menu EditCopy 
  255.          Caption         =   "&Copy"
  256.       End
  257.       Begin VB.Menu EditPaste 
  258.          Caption         =   "&Paste"
  259.       End
  260.    End
  261.    Begin VB.Menu Data 
  262.       Caption         =   "&Data"
  263.       Begin VB.Menu DataShow 
  264.          Caption         =   "Show Data"
  265.       End
  266.    End
  267.    Begin VB.Menu Test 
  268.       Caption         =   "Test"
  269.       Begin VB.Menu TestOne 
  270.          Caption         =   "Test One"
  271.       End
  272.       Begin VB.Menu TestAll 
  273.          Caption         =   "Test All"
  274.       End
  275.       Begin VB.Menu TestLights 
  276.          Caption         =   "View Lights"
  277.       End
  278.    End
  279.    Begin VB.Menu About 
  280.       Caption         =   "About"
  281.       Begin VB.Menu ATD 
  282.          Caption         =   "About This Demo"
  283.       End
  284.    End
  285. Attribute VB_Name = "frmMain"
  286. Attribute VB_GlobalNameSpace = False
  287. Attribute VB_Creatable = False
  288. Attribute VB_PredeclaredId = True
  289. Attribute VB_Exposed = False
  290. Option Explicit
  291. Private Sub ATD_Click()
  292.     Dim LF$
  293.     LF = Chr$(10)
  294.     MsgBox "Click on the chart pieces to select or drag " & _
  295.       "them (including dragging pie pieces)." & LF & LF & _
  296.       "Double Click on the chart pieces to invoke " & _
  297.       "the user interface." & LF & LF & _
  298.       "Select a data series and Shift-Double Click " & _
  299.       "to display the series number." & LF & LF & _
  300.       "Select a data point and Shift-Double Click " & _
  301.       "to display the data point value." & LF & LF & _
  302.       "Hold down the control key and drag the mouse " & _
  303.       "to rotate 3D charts."
  304. End Sub
  305. Private Sub cboChartType_Click()
  306.    With cboChartType
  307.       Select Case LastChartType
  308.       
  309.          Case ButtonVBar   ' Vertical Bar Charts
  310.             VBarIndex = .ListIndex
  311.             Call VBarChart
  312.       
  313.          Case ButtonHBar
  314.             HBarIndex = .ListIndex
  315.             Call HBarChart
  316.       
  317.          Case ButtonLine
  318.             LineIndex = .ListIndex
  319.             Call LineChart
  320.       
  321.          Case ButtonArea
  322.             AreaIndex = .ListIndex
  323.             Call AreaChart
  324.       
  325.          Case ButtonStep
  326.             StepIndex = .ListIndex
  327.             Call StepChart
  328.       
  329.          Case ButtonCombo
  330.             ComboIndex = .ListIndex
  331.             Call ComboChart
  332.       
  333.          Case ButtonPie
  334.             PieIndex = .ListIndex
  335.             Call PieChart
  336.       
  337.          Case ButtonXY
  338.             XYIndex = .ListIndex
  339.             Call XYChart
  340.       
  341.          Case ButtonPolar
  342.             PolarIndex = .ListIndex
  343.             Call PolarChart
  344.       
  345.          Case ButtonRadar
  346.             RadarIndex = .ListIndex
  347.             Call RadarChart
  348.       
  349.          Case ButtonBubble
  350.             BubbleIndex = .ListIndex
  351.             Call BubbleChart
  352.       
  353.          Case ButtonDoughnut
  354.             DoughnutIndex = .ListIndex
  355.             Call DoughnutChart
  356.       
  357.          Case ButtonHiLow
  358.             HilowIndex = .ListIndex
  359.             Call HiLowChart
  360.       
  361.          Case ButtonGantt
  362.             GanttIndex = .ListIndex
  363.             Call GanttChart
  364.       
  365.          Case ButtonOption
  366.             OptionIndex = .ListIndex
  367.             Call OptionChart
  368.       
  369.          Case ButtonMulti
  370.             MultiIndex = .ListIndex
  371.             Call MultiChart
  372.             
  373.         Case ButtonSChart
  374.             SChartIndex = .ListIndex
  375.             Call SurfaceChart
  376.       
  377.          Case Else
  378.             MsgBox "Add case to listbox event"
  379.       End Select
  380.    End With
  381. End Sub
  382. Private Sub DataRead_Click()
  383. End Sub
  384. Private Sub DataWrite_Click()
  385. End Sub
  386. Private Sub SSCommand1_Click()
  387.    ' Fill the chart list drop down box
  388.    With cboChartType
  389.       .Clear
  390.       
  391.       .AddItem "2D Bar"
  392.       .AddItem "2D Labeled"
  393.       .AddItem "2D +/- Data"
  394.       .AddItem "2D Picture Bars Tiled"
  395.       .AddItem "2D Picture Bars Stretch"
  396.       .AddItem "2D Stacked"
  397.       .AddItem "2D Stacked Percent"
  398.       
  399.       .AddItem "3D Bar"
  400.       .AddItem "3D Labeled"
  401.       .AddItem "3D Bar Styles"
  402.       .AddItem "3D Bar Walls"
  403.       .AddItem "3D Clustered"
  404.       .AddItem "3D +/- Floating"
  405.       
  406.       'cboChartType.AddItem "2D Skip Labels"
  407.       
  408.       ' If the chart type changes then start at the top of the list
  409.       ' If the chart type is the same then increment the chart
  410.       If LastChartType = ButtonVBar Then
  411.           VBarIndex = VBarIndex + 1
  412.           If VBarIndex = .ListCount Then VBarIndex = 0
  413.       Else
  414.           VBarIndex = 0
  415.       End If
  416.       LastChartType = ButtonVBar
  417.       .ListIndex = VBarIndex
  418.    End With
  419.    ' Display the new chart
  420. End Sub
  421. Private Sub SSCommand10_Click()
  422.    ' Fill the chart list drop down box
  423.    With cboChartType
  424.       .Clear
  425.       .AddItem "2D Radar"
  426.       .AddItem "2D No Axis"
  427.       .AddItem "2D Area"
  428.       ' If the chart type changes then start at the top of the list
  429.       ' If the chart type is the same then increment the chart
  430.       If LastChartType = ButtonRadar Then
  431.          RadarIndex = RadarIndex + 1
  432.          If RadarIndex = .ListCount Then RadarIndex = 0
  433.       Else
  434.          RadarIndex = 0
  435.       End If
  436.       LastChartType = ButtonRadar
  437.       .ListIndex = RadarIndex
  438.    End With
  439.    ' Display the new chart
  440. End Sub
  441. Private Sub SSCommand11_Click()
  442.    ' Fill the chart list drop down box
  443.    With cboChartType
  444.       .Clear
  445.       .AddItem "Bubble"
  446.       .AddItem "Bubble Ratio"
  447.       .AddItem "Bubble Labels"
  448.       ' If the chart type changes then start at the top of the list
  449.       ' If the chart type is the same then increment the chart
  450.       If LastChartType = ButtonBubble Then
  451.          BubbleIndex = BubbleIndex + 1
  452.          If BubbleIndex = .ListCount Then BubbleIndex = 0
  453.       Else
  454.          BubbleIndex = 0
  455.       End If
  456.       LastChartType = ButtonBubble
  457.       .ListIndex = BubbleIndex
  458.    End With
  459.    ' Display the new chart
  460. End Sub
  461. Private Sub SSCommand16_Click()
  462.    ' Fill the chart list drop down box
  463.    With cboChartType
  464.       .Clear
  465.       .AddItem "2D Multi-Dimensional"
  466.       .AddItem "3D Multi-Dimensional"
  467.       .AddItem "3D Multi-Dimensional Pie"
  468.       ' If the chart type changes then start at the top of the list
  469.       ' If the chart type is the same then increment the chart
  470.       If LastChartType = ButtonMulti Then
  471.           MultiIndex = MultiIndex + 1
  472.           If MultiIndex = .ListCount Then MultiIndex = 0
  473.       Else
  474.           MultiIndex = 0
  475.       End If
  476.       LastChartType = ButtonMulti
  477.       .ListIndex = MultiIndex
  478.    End With
  479. End Sub
  480. Private Sub SSCommand15_Click()
  481.    ' Fill the chart list drop down box
  482.    With cboChartType
  483.       .Clear
  484.       .AddItem "Title Fill Backdrop"
  485.       .AddItem "Title Gradient Backdrop"
  486.       .AddItem "Title Picture Backdrop"
  487.       .AddItem "BD Gradient Rectangle"
  488.       .AddItem "BD Gradient Oval"
  489.       .AddItem "BD Gradient Horizontal"
  490.       .AddItem "BD Gradient Vertical"
  491.       .AddItem "BD Picture Tiled"
  492.       .AddItem "Plot Gradient"
  493.       .AddItem "Plot BMP Picture"
  494.       .AddItem "Plot WMF Picture"
  495.       .AddItem "Projection Oblique"
  496.       .AddItem "Projection Perspective"
  497.       .AddItem "Highlighted Area"
  498.       .AddItem "Stick Chart"
  499.       .AddItem "Bar (Surface)"
  500.       .AddItem "Area Background"
  501.       ' If the chart type changes then start at the top of the list
  502.       ' If the chart type is the same then increment the chart
  503.       If LastChartType = ButtonOption Then
  504.           OptionIndex = OptionIndex + 1
  505.           If OptionIndex = .ListCount Then OptionIndex = 0
  506.       Else
  507.           OptionIndex = 0
  508.       End If
  509.       LastChartType = ButtonOption
  510.       .ListIndex = OptionIndex
  511.    End With
  512. End Sub
  513. Private Sub SSCommand13_Click()
  514.    ' Fill the chart list drop down box
  515.    With cboChartType
  516.       .Clear
  517.       .AddItem "Hi-Low"
  518.       .AddItem "Hi-Low-Close"
  519.       .AddItem "Open-Hi-Low-Close"
  520.       .AddItem "Hi-Low-Close Sidebar"
  521.       .AddItem "Hi-Low-Close Filled"
  522.       ' If the chart type changes then start at the top of the list
  523.       ' If the chart type is the same then increment the chart
  524.       If LastChartType = ButtonHiLow Then
  525.           HilowIndex = HilowIndex + 1
  526.           If HilowIndex = .ListCount Then HilowIndex = 0
  527.       Else
  528.           HilowIndex = 0
  529.       End If
  530.       LastChartType = ButtonHiLow
  531.       .ListIndex = HilowIndex
  532.    End With
  533.    ' Display the new chart
  534. End Sub
  535. Private Sub SSCommand14_Click()
  536.    ' Fill the chart list drop down box
  537.    With cboChartType
  538.       .Clear
  539.       .AddItem "2D Gantt"
  540.       .AddItem "2D Labeled"
  541.       .AddItem "2D Multiple Series"
  542.       .AddItem "2D Picture Bars"
  543.       .AddItem "3D Gantt"
  544.       .AddItem "3D Labeled"
  545.       ' If the chart type changes then start at the top of the list
  546.       ' If the chart type is the same then increment the chart
  547.       If LastChartType = ButtonGantt Then
  548.           GanttIndex = GanttIndex + 1
  549.           If GanttIndex = .ListCount Then GanttIndex = 0
  550.       Else
  551.           GanttIndex = 0
  552.       End If
  553.       LastChartType = ButtonGantt
  554.       .ListIndex = GanttIndex
  555.    End With
  556.    ' Display the new chart
  557. End Sub
  558. Private Sub SSCommand2_Click()
  559.    ' Fill the chart list drop down box
  560.    With cboChartType
  561.       .Clear
  562.       .AddItem "2D Horizontal Bar"
  563.       .AddItem "2D Labeled"
  564.       .AddItem "2D +/- Data"
  565.       .AddItem "2D Picture Bars"
  566.       .AddItem "2D Stacked"
  567.       .AddItem "2D Stacked Percent"
  568.       .AddItem "3D Horizontal Bar"
  569.       .AddItem "3D Labeled"
  570.       .AddItem "3D Thick Walls"
  571.       ' If the chart type changes then start at the top of the list
  572.       ' If the chart type is the same then increment the chart
  573.       If LastChartType = ButtonHBar Then
  574.           HBarIndex = HBarIndex + 1
  575.           If HBarIndex = .ListCount Then HBarIndex = 0
  576.       Else
  577.           HBarIndex = 0
  578.       End If
  579.       LastChartType = ButtonHBar
  580.       .ListIndex = HBarIndex
  581.    End With
  582.    ' Display the new chart
  583. End Sub
  584. Private Sub SSCommand3_Click()
  585.    ' Fill the chart list drop down box
  586.    With cboChartType
  587.       .Clear
  588.       .AddItem "2D Line"
  589.       .AddItem "2D Point Labels"
  590.       .AddItem "2D Series Labels"
  591.       .AddItem "2D +/- Data"
  592.       .AddItem "2D Smoothed"
  593.       .AddItem "2D Markers"
  594.       .AddItem "2D Line Styles"
  595.       .AddItem "2D Thick Lines"
  596.       .AddItem "2D Log Axis"
  597.       .AddItem "2D 2nd Y Axis"
  598.       .AddItem "2D Missing Data"
  599.       .AddItem "2D Statistics"
  600.       .AddItem "2D Guidelines"
  601.       .AddItem "3D Line"
  602.       .AddItem "3D Labeled"
  603.       .AddItem "3D Smoothed"
  604.       .AddItem "3D Line Styles"
  605.       'cboChartType.AddItem "3D Guidelines"
  606.       ' If the chart type changes then start at the top of the list
  607.       ' If the chart type is the same then increment the chart
  608.       If LastChartType = ButtonLine Then
  609.           LineIndex = LineIndex + 1
  610.           If LineIndex = .ListCount Then LineIndex = 0
  611.       Else
  612.           LineIndex = 0
  613.       End If
  614.       LastChartType = ButtonLine
  615.       .ListIndex = LineIndex
  616.    End With
  617.    ' Display the new chart
  618. End Sub
  619. Private Sub SSCommand12_Click()
  620.    ' Fill the chart list drop down box
  621.    With cboChartType
  622.       .Clear
  623.       .AddItem "3D Doughnut"
  624.       .AddItem "3D Multiple Doughnuts"
  625.       .AddItem "3D Exploded Pieces"
  626.       .AddItem "3D Labels"
  627.       .AddItem "3D Weighting"
  628.       .AddItem "3D Interior"
  629.       .AddItem "3D Thickness"
  630.       .AddItem "3D Shapes 5 Sides"
  631.       .AddItem "3D Shapes Cylinder"
  632.       ' If the chart type changes then start at the top of the list
  633.       ' If the chart type is the same then increment the chart
  634.       If LastChartType = ButtonDoughnut Then
  635.           DoughnutIndex = DoughnutIndex + 1
  636.           If DoughnutIndex = .ListCount Then DoughnutIndex = 0
  637.       Else
  638.           DoughnutIndex = 0
  639.       End If
  640.       LastChartType = ButtonDoughnut
  641.       .ListIndex = DoughnutIndex
  642.    End With
  643.    ' Display the new chart
  644. End Sub
  645. Private Sub SSCommand4_Click()
  646.    ' Fill the chart list drop down box
  647.    With cboChartType
  648.       .Clear
  649.       .AddItem "2D Area"
  650.       .AddItem "2D Stacked"
  651.       .AddItem "2D Smoothed"
  652.       .AddItem "2D Guide Lines"
  653.       .AddItem "3D Area"
  654.       .AddItem "3D Labeled"
  655.       .AddItem "3D Wide"
  656.       .AddItem "3D Smoothed"
  657.       ' If the chart type changes then start at the top of the list
  658.       ' If the chart type is the same then increment the chart
  659.       If LastChartType = ButtonArea Then
  660.           AreaIndex = AreaIndex + 1
  661.           If AreaIndex = .ListCount Then AreaIndex = 0
  662.       Else
  663.           AreaIndex = 0
  664.       End If
  665.       LastChartType = ButtonArea
  666.       .ListIndex = AreaIndex
  667.    End With
  668.    ' Display the new chart
  669. End Sub
  670. Private Sub SSCommand17_Click()
  671.    ' Fill the chart list drop down box
  672.    With cboChartType
  673.       .Clear
  674.       .AddItem "2D Step"
  675.       .AddItem "2D Stacked"
  676.       'cboChartType.AddItem "2D Guide Lines"
  677.       .AddItem "3D Step"
  678.       .AddItem "3D Labeled"
  679.       .AddItem "3D Wide"
  680.       ' If the chart type changes then start at the top of the list
  681.       ' If the chart type is the same then increment the chart
  682.       If LastChartType = ButtonStep Then
  683.           StepIndex = StepIndex + 1
  684.           If StepIndex = .ListCount Then StepIndex = 0
  685.       Else
  686.           StepIndex = 0
  687.       End If
  688.       LastChartType = ButtonStep
  689.       .ListIndex = StepIndex
  690.    End With
  691.    ' Display the new chart
  692. End Sub
  693. Private Sub SSCommand5_Click()
  694.    ' Fill the chart list drop down box
  695.    With cboChartType
  696.       .Clear
  697.       
  698.       .AddItem "2D Countour Lines"
  699.       .AddItem "2D Countour Bands"
  700.       .AddItem "3D Surface"
  701.       .AddItem "3D Surface (Pedestal)"
  702.       .AddItem "3D Surface (Gradients)"
  703.       .AddItem "3D Surface (Wireframe)"
  704.             
  705.       ' If the chart type changes then start at the top of the list
  706.       ' If the chart type is the same then increment the chart
  707.       If LastChartType = ButtonSChart Then
  708.           SChartIndex = SChartIndex + 1
  709.           If SChartIndex = .ListCount Then SChartIndex = 0
  710.       Else
  711.           SChartIndex = 0
  712.       End If
  713.       LastChartType = ButtonSChart
  714.       .ListIndex = SChartIndex
  715.    End With
  716.    ' Display the new chart
  717. End Sub
  718. Private Sub SSCommand6_Click()
  719.    ' Fill the chart list drop down box
  720.    With cboChartType
  721.       .Clear
  722.       .AddItem "2D Line/Bar"
  723.       .AddItem "2D Hi-Low/Bar"
  724.       .AddItem "3D Line/Bar"
  725.       .AddItem "3D Line/Bar/Area"
  726.       .AddItem "3D Step/Area"
  727.       ' If the chart type changes then start at the top of the list
  728.       ' If the chart type is the same then increment the chart
  729.       If LastChartType = ButtonCombo Then
  730.           ComboIndex = ComboIndex + 1
  731.           If ComboIndex = .ListCount Then ComboIndex = 0
  732.       Else
  733.           ComboIndex = 0
  734.       End If
  735.       LastChartType = ButtonCombo
  736.       .ListIndex = ComboIndex
  737.    End With
  738.    ' Display the new chart
  739. End Sub
  740. Private Sub SSCommand7_Click()
  741.    ' Fill the chart list drop down box
  742.    With cboChartType
  743.       .Clear
  744.       .AddItem "2D Pie Chart"
  745.       .AddItem "2D Multiple Pies"
  746.       .AddItem "2D Exploded Pieces"
  747.       .AddItem "2D Labels"
  748.       .AddItem "2D Weighting"
  749.       .AddItem "2D Start Angle"
  750.       .AddItem "2D Sorting"
  751.       .AddItem "3D Pie Chart"
  752.       .AddItem "3D Multiple Pies"
  753.       .AddItem "3D Exploded Pieces"
  754.       .AddItem "3D Labels"
  755.       .AddItem "3D Thick"
  756.       .AddItem "3D Thin"
  757.       .AddItem "3D Top Radius"
  758.       ' If the chart type changes then start at the top of the list
  759.       ' If the chart type is the same then increment the chart
  760.       If LastChartType = ButtonPie Then
  761.           PieIndex = PieIndex + 1
  762.           If PieIndex = .ListCount Then PieIndex = 0
  763.       Else
  764.           PieIndex = 0
  765.       End If
  766.       LastChartType = ButtonPie
  767.       .ListIndex = PieIndex
  768.    End With
  769.    ' Display the new chart
  770. End Sub
  771. Private Sub SSCommand8_Click()
  772.    ' Fill the chart list drop down box
  773.    With cboChartType
  774.       .Clear
  775.       .AddItem "2D XY"
  776.       .AddItem "2D Markers"
  777.       .AddItem "2D Picture Markers"
  778.       ' If the chart type changes then start at the top of the list
  779.       ' If the chart type is the same then increment the chart
  780.       If LastChartType = ButtonXY Then
  781.           XYIndex = XYIndex + 1
  782.           If XYIndex = .ListCount Then XYIndex = 0
  783.       Else
  784.           XYIndex = 0
  785.       End If
  786.       LastChartType = ButtonXY
  787.       .ListIndex = XYIndex
  788.    End With
  789.    ' Display the new chart
  790. End Sub
  791. Private Sub SSCommand9_Click()
  792.    ' Fill the chart list drop down box
  793.    With cboChartType
  794.       .Clear
  795.       .AddItem "2D Polar"
  796.       .AddItem "2D No Axis"
  797.       .AddItem "2D Start Angle"
  798.       .AddItem "2D Line Styles"
  799.       ' If the chart type changes then start at the top of the list
  800.       ' If the chart type is the same then increment the chart
  801.       If LastChartType = ButtonPolar Then
  802.           PolarIndex = PolarIndex + 1
  803.           If PolarIndex = .ListCount Then PolarIndex = 0
  804.       Else
  805.           PolarIndex = 0
  806.       End If
  807.       LastChartType = ButtonPolar
  808.       .ListIndex = PolarIndex
  809.    End With
  810. End Sub
  811. Private Sub CycleButton(TheButton As SSCommand)
  812.    Dim i%
  813.    TheButton.Value = True
  814.    Refresh
  815.    VtChart1.Repaint = True
  816.    For i = 1 To cboChartType.ListCount - 1
  817.       TheButton.Value = True
  818.       Refresh                 '' let the chart paint
  819.       cboChartType.Refresh    '' identify the chart
  820.    Next i
  821. End Sub
  822. Private Sub DataShow_Click()
  823.    frmData.show
  824.    frmData.Refresh
  825. End Sub
  826. Private Sub EditCopy_Click()
  827.    VtChart1.EditCopy
  828. End Sub
  829. Private Sub EditPaste_Click()
  830.    VtChart1.EditPaste
  831. End Sub
  832. Private Sub FileExit_Click()
  833.     End
  834. End Sub
  835. Private Sub FileMeta_Click()
  836.    On Error GoTo WriteWMFError
  837.    With CommonDialog1
  838.       .DialogTitle = "Write First Impression Metafile"
  839.       .DefaultExt = "wmf"
  840.       .Filter = "Metafiles|*.wmf"
  841.       .flags = &H2
  842.       .CancelError = True
  843.       .InitDir = App.Path
  844.       .ShowSave
  845.       
  846.       VtChart1.WritePictureToFile .filename, VtPictureTypeWMF, 0
  847.    End With
  848.    Exit Sub
  849. WriteWMFError:
  850.    MsgBox Error
  851. End Sub
  852. Private Sub FilePrint_Click()
  853.    VtChart1.PrintChart
  854. End Sub
  855. Private Sub FilePrinterSetup_Click()
  856.    VtChart1.PrintSetupDialog
  857. End Sub
  858. Private Sub FileRead_Click()
  859.    Dim cherror&
  860.    On Error GoTo FileReadError
  861.    With CommonDialog1
  862.       .DialogTitle = "Read First Impression Chart"
  863.       .DefaultExt = "vtc"
  864.       .Filter = "First Impression Chart|*.vtc"
  865.       .flags = &H1000
  866.       .CancelError = True
  867.       .InitDir = App.Path
  868.       .ShowOpen
  869.       
  870.       VtChart1.ReadFromFile .filename
  871.    End With
  872.    Exit Sub
  873. FileReadError:
  874.    MsgBox Error
  875. End Sub
  876. Private Sub FileWrite_Click()
  877.    Dim cherror&
  878.    On Error GoTo FileWriteError
  879.    With CommonDialog1
  880.       .DialogTitle = "Write First Impression Chart"
  881.       .DefaultExt = "vtc"
  882.       .Filter = "First Impression Chart|*.vtc"
  883.       .flags = &H2
  884.       .CancelError = True
  885.       .InitDir = App.Path
  886.       .ShowSave
  887.       VtChart1.WriteToFile .filename
  888.    End With
  889.    Exit Sub
  890. FileWriteError:
  891.    MsgBox Error
  892. End Sub
  893. Private Sub Form_Load()
  894.     ' Set the window up
  895.     Top = 0
  896.     Left = 0
  897.     Height = 7200
  898.     Width = 9615
  899.     ' Size the chart inside the window
  900.     VtChart1.Top = fraControls.Top + fraControls.Height + 50
  901.     VtChart1.Left = fraControls.Left
  902.     VtChart1.Width = ScaleWidth - VtChart1.Left - 30
  903.     VtChart1.Height = ScaleHeight - VtChart1.Top - 30
  904.     fraControls.Width = ScaleWidth - fraControls.Left - 30
  905.     ' Initialize chart list variables
  906.     'LastChartType = ButtonVBar
  907.     VBarIndex = -1
  908.     HBarIndex = -1
  909.     LineIndex = -1
  910.     AreaIndex = -1
  911.     StepIndex = -1
  912.     ComboIndex = -1
  913.     PieIndex = -1
  914.     XYIndex = -1
  915.     PolarIndex = -1
  916.     RadarIndex = -1
  917.     BubbleIndex = -1
  918.     DoughnutIndex = -1
  919.     HilowIndex = -1
  920.     GanttIndex = -1
  921.     OptionIndex = -1
  922.     MultiIndex = -1
  923.     SChartIndex = -1
  924.     ' Display the initial chart
  925.     SSCommand1 = True
  926. End Sub
  927. Private Sub Form_Resize()
  928.    If ScaleWidth > 1000 And ScaleHeight > 1000 Then
  929.       With VtChart1
  930.          .Repaint = False
  931.          .Width = frmMain.ScaleWidth - .Left - 30
  932.          .Height = frmMain.ScaleHeight - .Top - 30
  933.          .Repaint = True
  934.       End With
  935.       fraControls.Width = ScaleWidth - fraControls.Left - 30
  936.    End If
  937. End Sub
  938. Private Sub Form_Unload(Cancel As Integer)
  939.     End
  940. End Sub
  941. Private Sub TestAll_Click()
  942.    Call CycleButton(SSCommand1)
  943.    Call CycleButton(SSCommand2)
  944.    Call CycleButton(SSCommand3)
  945.    Call CycleButton(SSCommand4)
  946.    Call CycleButton(SSCommand17)
  947.    Call CycleButton(SSCommand6)
  948.    Call CycleButton(SSCommand7)
  949.    Call CycleButton(SSCommand8)
  950.    Call CycleButton(SSCommand9)
  951.    Call CycleButton(SSCommand10)
  952.    Call CycleButton(SSCommand11)
  953.    Call CycleButton(SSCommand12)
  954.    Call CycleButton(SSCommand13)
  955.    Call CycleButton(SSCommand14)
  956.    Call CycleButton(SSCommand15)
  957.    Call CycleButton(SSCommand16)
  958.    Call CycleButton(SSCommand5)
  959. End Sub
  960. Private Sub TestLights_Click()
  961.    Dim i%, light As Object
  962.    For Each light In VtChart1.Plot.light.LightSources
  963.       MsgBox "Light Information" & Chr$(13) & _
  964.          "Intensity: " & light.Intensity & Chr$(13) & _
  965.          "X: " & Chr$(9) & light.X & Chr$(13) & _
  966.          "Y: " & Chr$(9) & light.Y & Chr$(13) & _
  967.          "Z: " & Chr$(9) & light.Z & Chr$(13)
  968.    Next light
  969.    ' Turn off all current lights
  970.    With VtChart1.Plot.light.LightSources
  971.       For i = 1 To .Count
  972.          .Remove (i)
  973.       Next i
  974.    End With
  975.    ' Set the new light
  976.    VtChart1.Plot.light.LightSources.Add -1, -1, -1, 1
  977. End Sub
  978. Private Sub TestOne_Click()
  979.    Dim i%
  980.    ' Reset all chart options
  981.    Call DefaultChart
  982.    Call QReadData(App.Path + VBARDATA1)
  983.    With frmMain.VtChart1
  984.       For i = 1 To 50
  985.          .ChartType = VtChChartType3dBar
  986.          Refresh
  987.          .ChartType = VtChChartType2dBar
  988.          Refresh
  989.       Next i
  990.    End With
  991. End Sub
  992. Private Sub VtChart1_PointActivated(series As Integer, dataPoint As Integer, mouseFlags As Integer, Cancel As Integer)
  993.    Dim flags As Integer
  994.    Dim TheData As Double
  995.    flags = mouseFlags And VtChMouseFlagShiftKeyDown
  996.    If flags Then
  997.       frmMain.VtChart1.Row = dataPoint
  998.       frmMain.VtChart1.Column = series
  999.       TheData = frmMain.VtChart1.Data
  1000.       MsgBox "Series:" & Str$(series) & Chr$(10) & " Point:" & Str$(dataPoint) & Chr$(10) & " Data:" & Str$(TheData)
  1001.       Cancel = True ' Flag to bypass the UI
  1002.    End If
  1003. End Sub
  1004. Private Sub VtChart1_SeriesActivated(series As Integer, mouseFlags As Integer, Cancel As Integer)
  1005.     Dim flags As Integer
  1006.     Dim a As String
  1007.     flags = mouseFlags And VtChMouseFlagShiftKeyDown
  1008.     If flags Then
  1009.         a = "Series:" & Str$(series) + Chr$(10) + Chr$(10) + "Select a single data point before"
  1010.         a = a + Chr$(10) + "Shift-Double Clicking to see its value."
  1011.         MsgBox a
  1012.         Cancel = True ' Flag to bypass the UI
  1013.     End If
  1014. End Sub
  1015. Private Sub WriteBMP_Click()
  1016.    On Error GoTo WriteBitmapError
  1017.    With CommonDialog1
  1018.       .DialogTitle = "Write First Impression Bitmap"
  1019.       .DefaultExt = "bmp"
  1020.       .Filter = "Bitmaps|*.bmp"
  1021.       .flags = &H2
  1022.       .CancelError = True
  1023.       .InitDir = App.Path
  1024.       .ShowSave
  1025.       
  1026.       VtChart1.WritePictureToFile .filename, VtPictureTypeBMP, 0
  1027.    End With
  1028.    Exit Sub
  1029. WriteBitmapError:
  1030.    MsgBox Error
  1031. End Sub
  1032.